<template>
  <div class="paper-view">
    <PaperItem v-if="paper" :detail="true"  :paper="paper" class="paper-detail"></PaperItem>
  </div>
</template>
<script lang="ts" setup>
import { getMstPaperList, type IMstPaper } from '@/api/dialog'
import { ref, watch } from 'vue'
import PaperItem from './PaperItem.vue'
import { useRoute } from 'vue-router'

const route = useRoute()
const paperId = route.params.id
const getPaper = () => {
  getMstPaperList({
    ids: paperId as string,
    limit: 200,
    current: 1
  }).then(res => {
    const p = res.data.entity.rows?.[0]
    paper.value = p
  })
}

watch(route, () => {
  getPaper()
},{
  immediate: true
})

const paper = ref<IMstPaper>()
</script>
<style lang="scss" scoped>

.paper-view {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  position: relative;
  padding: 32px 32px 0;
  display: flex;
  flex-flow: column nowrap;
  .paper-detail {
    background: white;
    overflow: auto;
  }
}
</style>